package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class IODemo9 {
    public static void main(String[] args) throws IOException {
        //使用OutputStream来写文件
        //写上true就是追加写了
        try(OutputStream outputStream = new FileOutputStream("./test.txt",true)) {
            byte[] buffer = new byte[]{97, 98, 99, 100, 101, 102};
            //默认会清空掉（不是write引起的，而是OutputStream打开操作引起的）然后重新写
            outputStream.write(buffer);
        }
    }
}
